{! extends name="back/base" !}


{! block name="content" !}

<div class="content">
    <form class="pure-form pure-form-stacked" method="POST" action="/post_e">
        <input type="hidden" name="id" value="{=$info['id']|'0'}">
        {=$csrf_field}
        <fieldset>
            <legend><h2>文章编辑</h2></legend>

            <div class="pure-g">
                <div class="pure-u-1 pure-u-md-2-3">
                    <label for="title">标题</label>
                    <input id="title" class="pure-u-23-24" type="text" name="title" value="{=$info['title']}">
                </div>

                <div class="pure-u-1 pure-u-md-2-3">
                    <label for="slug">slug</label>
                    <input id="slug" class="pure-u-23-24" type="text" name="slug" value="{=$info['slug']}">
                </div>

                <div class="pure-u-1 pure-u-md-2-3">
                    <label for="cate">分类</label>
                    <select id="cate" class="pure-input-1-2" name="cate">
{! for $cate as $key => $val !}
                        <option value="{=$val['id']}" >{=$val['name']}</option>
{! endfor !}
                    </select>
                </div>

                <div class="pure-u-1 pure-u-md-2-3">
                    <label for="tags">标签</label>
                    <select id="tags" class="pure-input-1-2" name="tags">
{! for $tags as $key => $val !}
                        <option value="{=$val['id']}">{=$val['name']}</option>
{! endfor !}
                    </select>
                </div>

                <div class="pure-u-1 pure-u-md-2-3">
                    <label for="content">内容</label>
                    <textarea id="content" class="pure-u-23-24" style="height: 200px;" placeholder="markdown语法" name="content">{=$info['content']}</textarea>
                </div>

            </div>
<!-- 
            <label for="terms" class="pure-checkbox">
                <input id="terms" type="checkbox"> I've read the terms and conditions
            </label> -->

            <button type="submit" class="pure-button pure-button-primary">编辑</button>
        </fieldset>
    </form>
</div>

{! endblock !}